package com.fulin.thread.semaphore;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Task2{
	
	public static void main(String[] args) throws InterruptedException {
		final Service2 service = new Service2();
		ExecutorService exec = Executors.newCachedThreadPool();
		for(int i = 0;i<5;i++){
			exec.submit(new Runnable(){
				@Override
				public void run() {
					service.testMethod();
				}
			});
		}
		
		Thread.sleep(1000);
		
	}
}
